<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Functions  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">
    <script src="js/jquery.min.js" defer></script>
    <script src="js/jazzy.js" defer></script>
    
  </head>
  <body>


    <a title="Functions  Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="index.html">
          PerfectLib Docs
        </a>
         (70% documented)
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/PerfectlySoft/Perfect">
            <img class="header-icon" src="img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="index.html">PerfectLib Reference</a>
      <img class="carat" src="img/carat.png" />
      Functions  Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/Bytes.html">Bytes</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/File.html">File</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/File/OpenMode.html">– OpenMode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/HTTP2Client.html">HTTP2Client</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/HTTPServer.html">HTTPServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/JSONConvertibleObject.html">JSONConvertibleObject</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/JSONDecoding.html">JSONDecoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MimeReader.html">MimeReader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MimeReader/BodySpec.html">– BodySpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheEvaluationContext.html">MustacheEvaluationContext</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheEvaluationOutputCollector.html">MustacheEvaluationOutputCollector</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheGroupTag.html">MustacheGroupTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheParser.html">MustacheParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustachePartialTag.html">MustachePartialTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustachePragmaTag.html">MustachePragmaTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheTag.html">MustacheTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MustacheTemplate.html">MustacheTemplate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SysProcess.html">SysProcess</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/TemporaryFile.html">TemporaryFile</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Global Variables.html#/s:v10PerfectLib10fileStderrCS_4File">fileStderr</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Global Variables.html#/s:v10PerfectLib9fileStdinCS_4File">fileStdin</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Global Variables.html#/s:v10PerfectLib10fileStdoutCS_4File">fileStdout</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Global Variables.html#/s:v10PerfectLib22serverPerfectLibrariesSS">serverPerfectLibraries</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Enums.html">Enums</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPFilterPriority.html">HTTPFilterPriority</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPMethod.html">HTTPMethod</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPRequestFilterResult.html">HTTPRequestFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPRequestHeader.html">HTTPRequestHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPRequestHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPResponseFilterResult.html">HTTPResponseFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPResponseHeader.html">HTTPResponseHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPResponseHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HTTPResponseStatus.html">HTTPResponseStatus</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/JSONConversionError.html">JSONConversionError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/MustacheError.html">MustacheError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/PerfectError.html">PerfectError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Array.html">Array</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Bool.html">Bool</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Dictionary.html">Dictionary</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Int.html">Int</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/NetNamedPipe.html">NetNamedPipe</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/Optional.html">Optional</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UInt.html">UInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UnicodeScalar.html">UnicodeScalar</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_17HTTPRequestHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_18HTTPResponseHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:ZF10PerfectLiboi2eeFTOS_10HTTPMethodS0__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib10empty_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">empty_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib10formatDateFzTSd6formatSS8timezoneGSqSS_6localeGSqSS__SS">formatDate(_:format:timezone:locale:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib6getNowFT_Sd">getNow()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib16icuDateToSecondsFSdSi">icuDateToSeconds(_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib15mustacheRequestFT7requestPS_11HTTPRequest_8responsePS_12HTTPResponse_7handlerPS_19MustachePageHandler_12templatePathSS_T_">mustacheRequest(request:response:handler:templatePath:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib11random_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">random_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Functions.html#/s:F10PerfectLib16secondsToICUDateFSiSd">secondsToICUDate(_:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/HTTPRequest.html">HTTPRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/HTTPRequestFilter.html">HTTPRequestFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/HTTPResponse.html">HTTPResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/HTTPResponseFilter.html">HTTPResponseFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/HeaderListener.html">HeaderListener</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/JSONConvertible.html">JSONConvertible</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/MustachePageHandler.html">MustachePageHandler</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Structs.html">Structs</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/Dir.html">Dir</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/Encoding.html">Encoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/GenerateFromPointer.html">GenerateFromPointer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/HTTPCookie.html">HTTPCookie</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/HTTPCookie/Expiration.html">– Expiration</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/JSONConvertibleNull.html">JSONConvertibleNull</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs.html#/s:V10PerfectLib3Log">Log</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/MimeType.html">MimeType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/MimeType/TopType.html">– TopType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/PerfectServer.html">PerfectServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/RouteMap.html">RouteMap</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/Routing.html">Routing</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/StaticFileHandler.html">StaticFileHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/UTF8Encoding.html">UTF8Encoding</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>Functions</h1>
            <p>The following functions are available globally.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:ZF10PerfectLiboi2eeFTOOS_17HTTPRequestHeader4NameS1__Sb"></a>
                    <a name="//apple_ref/swift/Function/==(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:ZF10PerfectLiboi2eeFTOOS_17HTTPRequestHeader4NameS1__Sb">==(_:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:ZF10PerfectLiboi2eeFTOOS_18HTTPResponseHeader4NameS1__Sb"></a>
                    <a name="//apple_ref/swift/Function/==(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:ZF10PerfectLiboi2eeFTOOS_18HTTPResponseHeader4NameS1__Sb">==(_:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:ZF10PerfectLiboi2eeFTOS_10HTTPMethodS0__Sb"></a>
                    <a name="//apple_ref/swift/Function/==(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:ZF10PerfectLiboi2eeFTOS_10HTTPMethodS0__Sb">==(_:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Compare two HTTP methods</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt"><a href="Enums/HTTPMethod.html">HTTPMethod</a></span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt"><a href="Enums/HTTPMethod.html">HTTPMethod</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib15mustacheRequestFT7requestPS_11HTTPRequest_8responsePS_12HTTPResponse_7handlerPS_19MustachePageHandler_12templatePathSS_T_"></a>
                    <a name="//apple_ref/swift/Function/mustacheRequest(request:response:handler:templatePath:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib15mustacheRequestFT7requestPS_11HTTPRequest_8responsePS_12HTTPResponse_7handlerPS_19MustachePageHandler_12templatePathSS_T_">mustacheRequest(request:response:handler:templatePath:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Convenience function to begin a mustache template request</p>

<pre class="highlight swift"><code><span class="kt">Routing</span><span class="o">.</span><span class="kt">Routes</span><span class="p">[</span><span class="s">"/"</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
    <span class="n">request</span><span class="p">,</span> <span class="n">response</span> <span class="k">in</span>
    <span class="nf">mustacheRequest</span><span class="p">(</span><span class="nv">request</span><span class="p">:</span> <span class="n">request</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="n">response</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kt">UploadHandler</span><span class="p">(),</span> <span class="nv">path</span><span class="p">:</span> <span class="n">webRoot</span> <span class="o">+</span> <span class="s">"/index.mustache"</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">mustacheRequest</span><span class="p">(</span><span class="n">request</span> <span class="nv">req</span><span class="p">:</span> <span class="kt">WebRequest</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">WebResponse</span><span class="p">,</span> <span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="Protocols/MustachePageHandler.html">MustachePageHandler</a></span><span class="p">,</span> <span class="nv">templatePath</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib10empty_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__"></a>
                    <a name="//apple_ref/swift/Function/empty_uuid()" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib10empty_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">empty_uuid()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns an empty all zeros uuid_t</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">empty_uuid</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">uuid_t</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib11random_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__"></a>
                    <a name="//apple_ref/swift/Function/random_uuid()" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib11random_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">random_uuid()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Generate and return a random uuid_t</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">random_uuid</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">uuid_t</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib6getNowFT_Sd"></a>
                    <a name="//apple_ref/swift/Function/getNow()" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib6getNowFT_Sd">getNow()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the current time according to ICU
ICU dates are the number of milliseconds since the reference date of Thu, 01-Jan-1970 00:00:00 GMT</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getNow</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Double</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib16icuDateToSecondsFSdSi"></a>
                    <a name="//apple_ref/swift/Function/icuDateToSeconds(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib16icuDateToSecondsFSdSi">icuDateToSeconds(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Converts the milliseconds based ICU date to seconds since the epoch</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">icuDateToSeconds</span><span class="p">(</span><span class="n">_</span> <span class="nv">icuDate</span><span class="p">:</span> <span class="kt">Double</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib16secondsToICUDateFSiSd"></a>
                    <a name="//apple_ref/swift/Function/secondsToICUDate(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib16secondsToICUDateFSiSd">secondsToICUDate(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Converts the seconds since the epoch into the milliseconds based ICU date</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">secondsToICUDate</span><span class="p">(</span><span class="n">_</span> <span class="nv">seconds</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Double</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:F10PerfectLib10formatDateFzTSd6formatSS8timezoneGSqSS_6localeGSqSS__SS"></a>
                    <a name="//apple_ref/swift/Function/formatDate(_:format:timezone:locale:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:F10PerfectLib10formatDateFzTSd6formatSS8timezoneGSqSS_6localeGSqSS__SS">formatDate(_:format:timezone:locale:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Format a date value according to the indicated format string and return a date string.
- parameter date: The date value
- parameter format: The format by which the date will be formatted
- parameter timezone: The optional timezone in which the date is expected to be based. Default is the local timezone.
- parameter locale: The optional locale which will be used when parsing the date. Default is the current global locale.
- returns: The resulting date string
- throws: <code>PerfectError.ICUError</code>
- Seealso <a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax">Date Time Format Syntax</a></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">formatDate</span><span class="p">(</span><span class="n">_</span> <span class="nv">date</span><span class="p">:</span> <span class="kt">Double</span><span class="p">,</span> <span class="nv">format</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">timezone</span> <span class="nv">inTimezone</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">locale</span> <span class="nv">inLocale</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>date</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The date value</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>format</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The format by which the date will be formatted</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>timezone</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The optional timezone in which the date is expected to be based. Default is the local timezone.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>locale</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The optional locale which will be used when parsing the date. Default is the current global locale.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The resulting date string</p>

                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>© 2016 PerfectlySoft Inc. and the Perfect project authors</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
